<?php

class PublicCloud extends MY_Controller{


	function __construct(){
		parent::__construct();
	}

	function index(){
	
		$result = $this->check_login_status();
		$data = array(
			'userName' => $result['userName'],
			'url' => $result['url'],
			'menu_item' => 'index'
		);

		$this->load->view('publicCloud/header',$data);
		$this->load->view('publicCloud/main_view');
		$this->load->view('publicCloud/footer');
	}

	function resource_display(){
		
		$result = $this->check_login_status();
		//pagination
		$config['base_url'] = 'http://localhost/EECloud/index.php/publicCloud/resource_display';
		$config['total_rows'] = $this->db->get('public_resource')->num_rows();
		$config['per_page'] = 10;
		$config['num_links'] = 20;
		$config['full_tag_open'] = '<div id="pagination">';
		$config['full_tag_close'] = '</div>';
		$this->pagination->initialize($config);
		$resources = $this->db->get('public_resource',$config['per_page'],$this->uri->segment(3))->result();
		$data = array(
			'resources' => $resources,
			'userName' => $result['userName'],
			'url' => $result['url'],
			'menu_item' => 'resource_display'
		);
		$this->load->view('publicCloud/header',$data);
		$this->load->view('publicCloud/resource_view');
		$this->load->view('publicCloud/footer');
	}

}